<?php defined('SYSPATH') or die('No direct access allowed.');

class Model_User_Experience extends ORM {

	// Relationships
	protected $_belongs_to = array('user' => array());
        
                // Rules
        public function rules()
	{
		return array(
			'employer' => array(
				array('not_empty'),
				array('max_length', array(':value', 255)),
			),
                        'position' => array(
				array('not_empty'),
				array('max_length', array(':value', 255)),                        
			),                    
                        'date_start' => array(
				array('not_empty'),
				array('date'),                      
			),
                        'date_end' => array(
				
                                array('date'),                      
			),
		);
	}
        
        public function filters()
	{
		return array(
			'employer' => array(
                                //xss clean
				array(array('Security', 'xss_clean')),
                                array('trim')
			),
                        'position' => array(
                                array(array('Security', 'xss_clean')),
                                array('trim')
                        ),
                        'responsibilities' => array(
				array(array('Security', 'xss_clean')),
                                array('trim')
			),
                        'date_start' => array(
                                array(array('Security', 'xss_clean'))
                        ),
                       // 'date_end' => array(
			//	array(array('Security', 'xss_clean'))
			//),                        
		);
	}

	/**
	 * Labels for fields in this model
	 *
	 * @return array Labels
	 */
	public function labels()
	{
		return array(
			'employer'          => __('Employer'),
			'position'          => __('Position'),
			'responsibilities'  => __('Responsibilities'),
                        'date_start'        => __('Start date'),
			'date_end'          => __('End date'),
		);
	}
}